package com.atguigu.gmall.activity.mapper;

import com.atguigu.gmall.model.activity.SeckillGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/***
 * 秒杀商品表的dao层映射
 */
@Mapper
public interface SeckillGoodsMapper extends BaseMapper<SeckillGoods> {

    /**
     * 根据秒杀商品id修改库存
     * @param seckillGoodsId
     * @param stockCount
     * @return
     */
    @Update("UPDATE `seckill_goods` SET stock_count = #{stockCount} WHERE id = #{seckillGoodsId};")
    int updateStock(Object seckillGoodsId, long stockCount);
}
